package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;

public class ObjectOutputStreamDemo {

    public static void main(String[] args) throws IOException  {
        OutputStream out = new FileOutputStream("test.txt");
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(out);
        objectOutputStream.writeObject(new Person(1,"abc" , "123456"));
        objectOutputStream.close();
        out.close();
    }
}
